package au.edu.unsw.infs3634.gamifiedlearning;

import java.util.ArrayList;

public class Question<questions> {
    private String question;
    private String questionans1;
    private String questionans2;
    private String questionans3;
    private String questionans4;
    private String ans;
    private String continent;
    private int questionNumber;

    public Question(String continent, int questionNumber, String question, String questionans1, String questionans2, String questionans3, String questionans4, String ans) {
        this.question = question;
        this.questionans1 = questionans1;
        this.questionans2 = questionans2;
        this.questionans3 = questionans3;
        this.questionans4 = questionans4;
        this.ans = ans;
        this.continent = continent;
        this.questionNumber = questionNumber;
    }

    //getters & setters
    public String getQuestion() {
        return question;
    }
    public void setQuestion(String question) {
        this.question = question;
    }
    public String getQuestionans1() {
        return questionans1;
    }
    public void setQuestionans1(String questionans1) {
        this.questionans1 = questionans1;
    }
    public String getQuestionans2() {
        return questionans2;
    }
    public void setQuestionans2(String questionans2) {
        this.questionans2 = questionans2;
    }
    public String getQuestionans3() {
        return questionans3;
    }
    public void setQuestionans3(String questionans3) {
        this.questionans3 = questionans3;
    }
    public String getQuestionans4() {
        return questionans4;
    }
    public void setQuestionans4(String questionans4) {
        this.questionans4 = questionans4;
    }
    public String getans() {
        return ans;
    }
    public void setAns(String ans) {
        this.ans = ans;
    }
    public String getContinent() {
        return continent;
    }
    public void setContinent(String continent) {
        this.continent = continent;
    }
    public int getQuestionNumber() {
        return questionNumber;
    }
    public void setQuestionNumber(int questionNumber) {
        this.questionNumber = questionNumber;
    }

    //data
    public static ArrayList<Question> getQuestions() {
        ArrayList<Question> questions = new ArrayList<>();
        questions.add(new Question("Asia",1,"What’s the FULL name of China?","The United Kingdom of China", "The People’s Republic of China","The United Province of China","The Freedom of China","b"));
        questions.add(new Question("Asia",2,"Which time zone does Japan belong to?","UTC+8", "UTC+9","UTC+10","UTC+7","b"));
        questions.add(new Question("Asia",3,"Which capital city is located at Asia?","Moscow", "Washington","Berlin","New Delhi","d"));
        questions.add(new Question("Asia",4,"What is country code of India?","CHN", "JPN","IND","IDN","c"));
        questions.add(new Question("Asia",5,"What is the calling code of Indonesia?","+62", "+86","+61","+886","c"));
        return questions;
    }

    //return questions
    public static Question findQuestion(String name) {
        ArrayList<Question> questions = Question.getQuestions();
        for (Question question : questions) {
            if (question.getContinent().equals(name)) {
                return question;
            }
        }
        return null;
    }
}

